package com.ecp.commons.filter;

import java.util.ArrayList;
import java.util.List;

import javax.servlet.http.HttpServletRequest;

import org.springframework.web.filter.CharacterEncodingFilter;
/**
 * 
 * @author Administrator wjy
 *
 * 为解决非utf-8编码的请求乱码的问题做的过滤器
 */
public class PZCharacterEncodingFilter extends CharacterEncodingFilter{
	
	private List<String> notFilterUrls = new ArrayList<String>();
	
	public void setNotFilterUrls(String strs){
		for(String str : strs.split(",")){
			notFilterUrls.add(str);
		}
	}
	
	public boolean shouldNotFilter(HttpServletRequest request){
		String uri = request.getRequestURI();
		return notFilterUrls.contains(uri);
	}
	
}
